﻿// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

//using System;
//using System.Net;
//using System.Windows;
//using System.Windows.Controls;
//using System.Windows.Documents;
//using System.Windows.Ink;
//using System.Windows.Input;
//using System.Windows.Media;
//using System.Windows.Media.Animation;
//using System.Windows.Shapes;
//using System.Windows.Interactivity;

//namespace Microsoft.Samples
//{
//    public class BaseOutOfBrowserBehaviorElevatedPermissions<T> : BaseOutOfBrowserBehavior<T>
//    {
//        protected override void OnAttached()
//        {
//            if (!Application.Current.HasElevatedPermissions)
//            {
//                FrameworkElement _element;
//                _element = this.AssociatedObject as FrameworkElement;
//                _element.Visibility = Visibility.Collapsed;
//            }
//            base.OnAttached();


//        }

//        public bool HideWhenApplicationHasNoElevatedPrivileges
//        {
//            get { return (bool)GetValue(HideWhenApplicationHasNoElevatedPrivilegesProperty); }
//            set { SetValue(HideWhenApplicationHasNoElevatedPrivilegesProperty, value); }
//        }

//        // Using a DependencyProperty as the backing store for HideWhenApplicationHasNoElevatedPrivileges.  This enables animation, styling, binding, etc...
//        public static readonly DependencyProperty HideWhenApplicationHasNoElevatedPrivilegesProperty =
//            DependencyProperty.Register(
//                "HideWhenApplicationHasNoElevatedPrivileges", 
//                typeof(bool),
//                typeof(BaseOutOfBrowserBehaviorElevatedPermissions), 
//                new PropertyMetadata(true));

//    }
//}
